home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(load){
- function getAngle()
- {
- if(InAirCauseJet)
- {
- Angle = 0;
- return undefined;
- }
- yDis = _root[target2]._y - _root[target1]._y;
- deltaX = _root[target1]._x - _root[target2]._x;
- deltaY = _root[target1]._y - _root[target2]._y;
- angle = - Math.atan2(deltaX,deltaY);
- if(_root[target1].onfloor)
- {
- if(_root[target2].onfloor)
- {
- Angle = Math.round(angle * 180 / 3.141592653589793) - 90;
- }
- }
- if(!jet)
- {
- if(!onfloor)
- {
- if(!_root[target1].onfloor)
- {
- if(!_root[target2].onfloor)
- {
- if(xSpeed >= 0)
- {
- Angle += 2;
- }
- if(xSpeed < 0)
- {
- Angle -= 2;
- }
- }
- }
- }
- }
- }
- InAirCauseJet = false;
- _visible = false;
- jet = false;
- xAccel = 0.8;
- gravity = 0.5;
- xSpeed = 0;
- ySpeed = 0;
- maxX = 10;
- maxY = 10;
- target1 = this._name + "p1";
- _root.attachMovie("p1",target1,87778);
- _root.depthHolder = _root.depthHolder + 1;
- _root[target1].parent = this;
- target2 = this._name + "p2";
- _root.attachMovie("p2",target2,89798);
- _root.depthHolder = _root.depthHolder + 1;
- _root[target2].parent = this;
- }
-